<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="app">
        <!-- 绑定事件的时候没加小括号，默认有参数，参数就是事件对象 -->
        <button @click="fn1">按钮1-没加小括号</button>
        <!-- 绑定事件时加了小括号，就代表你要自己传参 -->
        <!-- 此时你传了什么，形参就是什么 -->
        <button @click="fn1()">按钮2-加了小括号</button>
        <button @click="fn1(16)">按钮3-加了小括号-传值</button>
        <hr>
        <button @click="fn2(10, 16)">按钮4-传两个参数</button>

        <!-- 如果既想传参，又想拿到事件对象，就用$event代表事件对象 -->
        <button @click="fn2(10, $event)">按钮5-传参并拿事件对象</button>
    </div>
    <script src="./vue.js"></script>
    <script>
        new Vue({
            el: '#app',
            methods: {
                fn1 (e) {
                    console.log('fn1被调用', e)
                },
                fn2 (n1, e) {
                    console.log('fn2被调用', n1, e)
                }
            }
        })
    </script>
</body>
</html>